package com.xyw.code.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by xuyiwei on 2019/8/11.
 */
public class UserConstant {
    /**
     * 用户状态枚举
     */
    @Getter
    @AllArgsConstructor
    public enum  UserStatusEnum {

        DELETE(0, "删除"),
        NORMAL(1, "正常"),
        LOCK(2, "锁住"),
        ;


        private int type;
        private String description;


        public static UserStatusEnum valueOf(int type) {
            for(UserStatusEnum typeVar : UserStatusEnum.values()) {
                if(typeVar.getType() == type) {
                    return typeVar;
                }
            }
            return  NORMAL;
        }
    }
}
